package com.chinasoft.userservice.controller;

import com.chinasoft.ms.pojo.MyToken;
import com.chinasoft.ms.pojo.User;
import com.chinasoft.userservice.service.UserService;
import com.chinasoft.userservice.utils.JwtUtils;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.*;

@RestController
public class UserMicroController {

    @Autowired
    UserService userService;


    @GetMapping("/user/{id}")
    public User getUserWithId(@PathVariable Long id) {
        return userService.getUserWithId(id);
    }

    @GetMapping("/role/{id}")
    public int getUserroleWithId(@PathVariable Long id) {
        return userService.getUserRoleWithId(id);
    }

}
